package com.joy.mapper;

import com.joy.model.Assignment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;

@Mapper
public interface AssignmentMapper {

    // 插入一个新的任务
    int insertAssignment(Assignment assignment);

    // 根据任务ID查询任务
    Assignment selectAssignmentById(@Param("assignmentId") int assignmentId);

    // 查询所有任务
    List<Assignment> selectAllAssignments();

    // 更新任务信息
    int updateAssignment(Assignment assignment);

    // 删除任务
    int deleteAssignmentById(@Param("assignmentId") int assignmentId);

    // 查询某个课程下的所有任务
    List<Assignment> selectAssignmentsByCourseId(@Param("courseId") int courseId);
}